[READY] add token disable config/logic in the frontend#607
Conversation
✅ Deploy Preview for pendulum-pay ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces token disable configuration and logic in the frontend to control the availability of fiat tokens. Key changes include adding default token constants and updating stores, enhancing URL parameter processing and validation for token availability, and integrating token unavailability events in the events context.
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/stores/rampDirectionStore.ts | Introduces a default ramp direction constant used in the store initialization. |
| frontend/src/stores/ramp/useRampFormStore.ts | Adds default fiat token constants and uses them in the initial store values. |
| frontend/src/hooks/useRampUrlParams.ts | Updates URL parameter handling to leverage token defaults and fiat token status. |
| frontend/src/hooks/ramp/useRampValidation.ts | Adds token availability validation with event tracking for disabled tokens. |
| frontend/src/contexts/events.tsx | Introduces a new TokenUnavailableErrorEvent interface in the events context. |
| frontend/src/config/tokenAvailability.ts | Provides a central configuration for fiat token availability and associated helpers. |
| frontend/src/components/Ramp/Onramp/index.tsx | Removes an unused hook import. |
| frontend/src/components/InputKeys/SelectionModal.tsx | Adds a check for disabled tokens when handling token selection. |
| frontend/src/components/InputKeys/PoolListItem/index.tsx | Updates the UI to visually indicate unavailable tokens with styling and messaging. |
Files not reviewed (2)
- frontend/src/translations/en.json: Language not supported
- frontend/src/translations/pt.json: Language not supported
ebma
left a comment
There was a problem hiding this comment.
Looks good overall. Thanks for the refactor 👍 We should fix that translation key though before merging.
| }, | ||
| "insufficientFunds": "Saldo insuficiente. Seu saldo é {{userInputTokenBalance}} {{assetSymbol}}", | ||
| "moreThanMaximumWithdrawal": { | ||
| "sell": "O valor máximo de compra é {{maxAmountUnits}} {{assetSymbol}}.", |
There was a problem hiding this comment.
I think the problem here is not a duplicate but the same key name, ie both being called "sell". Please re-add the key and call it "buy" instead.
No description provided.